<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%>
<%
String names = (String) request.getSession().getAttribute("name");
List<Map<String, Object>> list=null;
BigDecimal goodnum=new BigDecimal("0.00");
BigDecimal zsq=new BigDecimal("0.00");
if(names!=null){
 String sql = "select a.zsq,b.goodnum from member a,clientwallet b where a.userid=b.userid and a.userid=?";
 String[] params = new String[1];
 params[0] =names; 
 list= db.queryList(sql, params);	
	for (Map<String, Object> m : list) {
		goodnum=new BigDecimal(m.get("goodnum").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
		zsq=new BigDecimal(m.get("zsq").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);			
	}
}
MyDB db2 = My.getDb1();
String sql2 = "select * from useraccountdetail where userid=?";
String[] params2 = new String[1];
params2[0] =names; 
List<Map<String, Object>> list2 = db2.queryList(sql2, params2);
%>
<script type="text/javascript">
$(document).ready(function() {	
	$("#goodnum").text('<%=goodnum.toPlainString()%>');
	$("#zsq").html('<%=zsq.toPlainString()%>');
});
</script>
<body>
	<div class="warp clearfloat">
		<header class="top-header">
			<a class="icona" href="self.jsp"> <img
				src="images/left.png" />
			</a>
			<h3>消费记录</h3>
			
		</header>
		<div class="main clearfloat" id="main">
			<div class="balance clearfloat">
				<div class="top clearfloat box-s">
					<p class="dqian" style="font-size:18px;">当前余额</p>
					<div>
					
						<div style="width:50%;font-size:15px;float:left">
							<p class="bt">我的现金币</p>
							<p class="price" id="goodnum">0.00</p>
						</div>
						<div style="font-size:15px;">
							<p class="bt">我的积分</p>
								<p class="price" id="zsq">0.00</p>
						</div>
					</div>
				
					
						<a href="chongzhi.jsp" class="ba-btn fl">
							充值
						</a> 
				</div>
				<div class="bottom clearfloat mt10 box-s">
					<p class="tit box-s">最近30天收支明细</p>
					<%
						for (Map<String, Object> m : list2) {
							String comment=(String)m.get("comment");
							int classid=(Integer)m.get("classid");
							String createdate=(String)m.get("createdate");
							BigDecimal amount=new BigDecimal(m.get("amount").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
							BigDecimal balance=new BigDecimal(m.get("balance").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
							String fuhao=null;
							if(classid==1){
								fuhao="-";
							}
							if(classid==2){
								fuhao="+";
							}
					%>
					<div class="list fl box-s clearfloat">
						<ul>
							<li class="fl"><span class="dsan fl"><%=comment %></span> <span
								class="time fr"><%=createdate %></span></li>
							<li class="fl mt5">
								<span class="jiage fr"><%=fuhao %><%=amount %></span>
								&nbsp;&nbsp;&nbsp;&nbsp;
								<span class="yue fl">余额：<%=balance %></span>
							</li>
							
						</ul>
					</div>
					<%}%>
				</div>
			</div>
		</div>
		<%@ include file="pub/bottom_list41.jsp"%>